<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2007-2008 Starbugs (univis2typo3@googlegroups.com)
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*  A copy is found in the textfile GPL.txt and important notices to the license
*  from the author is found in LICENSE.txt distributed with these scripts.
*
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
 * Module: Web>UnivIS2Typo3
 *
 * Description:
 *
 * Notice: 
 *
 *  
 * @author	Starbugs <univis2typo3@googlegroups.com>
 */

require_once(t3lib_extMgm::extPath('univis2typo3').'/mod1/configuration/class.configuration.editordertable.php');

class ConfigurationProjects
extends ConfigurationEditOrderTable
{
	function renderContent($id) {
	    $this->sectionName_ = 'pub';
	    return parent::renderContent($id);
	}

	function renderList() {
		//$query = "SELECT * FROM `tx_u2t3_research_group` WHERE is_group =1 AND display=1 ORDER BY sorting";
		$query = "SELECT description FROM `tx_u2t3_research_group`";
		$rows = performSQLQuery($query);
		$content = '<div style="text-align:right;"><select name="top5" size="1">';
		if (count($rows) > 0) {
	    	foreach($rows as $item) {
	    		$content .= '<option>'.$item[description].'</option>';
	    	}
	    }
	    $content .= '</select></div>';
//	    ob_start();
//	    $this->checkPublicationTypes();
//	    $output .= "asdf".ob_get_contents();
//	    ob_end_clean();
//
//	    $content .= $this->template->header("Publication Types");
//	    $this->template->table_TABLE = '<table border="1" cellspacing="0" cellpadding="3" id="typo3-tmpltable">';
//	    $content .= $this->template->table($this->getPublicationTypes());
//
//	    $content .= '<br />'.$output;
	    return $content;
	}

	function getPublicationTypes() {
	    return $this->getListItems('type');
	}

	/** check whether all publication types are listed in the order table
	 */
	function checkPublicationTypes() {
	    return $this->checkItemExistance('u_pub', 'tx_u2t3_pub_type_order', 'type');
	}
}
?>
